package com.app.config;

import com.app.processor.SsoServerProcesssor;
import com.portal.sso.core.server.JwtServerHander;
import com.portal.sso.core.server.VerificationTgtServer;
import com.portal.sso.core.server.impl.JwtServerHanderImpl;
import com.portal.sso.core.server.impl.VerificationTgtServerImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class AppConfig {
    @Autowired
    SsoServerProcesssor ssoServerProcesssor;
    @Bean
    public JwtServerHander jwtServerHanderImpl(){
        return new JwtServerHanderImpl();
    }
    @Bean
    public VerificationTgtServer verificationTgtServer(){
        VerificationTgtServer server = new VerificationTgtServerImpl();
        server.setClientAppId(ssoServerProcesssor.getClientAppId());
        server.setClientSecret(ssoServerProcesssor.getClientSecret());
        server.setJwtServerHander(jwtServerHanderImpl());
        return server;
    }
}
